package com.rui.study.algorithm.T_Java的引用和ThreadLocal那些事儿;

import java.lang.ref.WeakReference;

public class WeakReferenceTest {

    public static void main(String[] args) {
        WeakReference softReference = new WeakReference(new User("yaowenrui", 27));

        System.out.println("gc前：" + softReference.get());
        System.gc();
        System.out.println("gc后：" + softReference.get());
    }
}
